# -*- coding: UTF-8 -*-

import cv2.cv as cv
import time

cv.NamedWindow("camera", 1)

capture = cv.CaptureFromCAM(0)

pt_topleft = (20, 20)
pt_buttomright = (120, 120)

while True:
    img = cv.QueryFrame(capture)
    cv.Rectangle(img, pt_topleft, pt_buttomright, 0xFFFFFF, 1, cv.CV_AA, 0)
    cv.ShowImage("camera", img)
    if cv.WaitKey(10) == 27:
        break
